package sy2e6;

public class PrinterDemo {
void onClickScanDemo(Printer p,String content){
	p.print(content);
}
void onClickScanDemo(IScan s){
	String result=s.scan();
	System.out.println(result);	
}
public static void main(String[] args) {
	PrinterDemo demo=new PrinterDemo();
	Printer ps[]={new InkPrinter(),new LasePrinter()};
	demo.onClickScanDemo(ps[0], "Test");
	demo.onClickScanDemo(ps[1], "Test");
	IScan s=(IScan)ps[0];
	demo.onClickScanDemo(s);
}
}
